import axios from '@/utils/axios'

let addressURL = 'addressservice/address/getAddress'
let getCodeURL = '/addressservice/address/getCode'
let delAddressURL = '/addressservice/address/deleteAddress'
let addAddressURL = '/addressservice/address/addAddress'
let updateAddressURL = '/addressservice/address/updateAddress'

const address = {
    getAddress(data){
        return axios.post(addressURL, data)
    },

    getCode(region){
        return axios.get(getCodeURL + '?region=' + region)
    },

    delAddress(data){
        return axios.delete(delAddressURL, {data})
    },
    addAddress(data){
        return axios.post(addAddressURL, data)
    },
    updateAddress(data){
        return axios.put(updateAddressURL, data)
    },
}

export default address